package com.ort.ezcalendar;

import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Properties;

import android.content.Context;
import android.content.res.AssetManager;
import android.content.res.Resources;


public class Sistema {
    private static Sistema instance = null;
    private List<Date> alarmListOld;
    private List<Date> alarmListNew;
    private Double latitud, longitud;
    private Boolean logueado;
    
    public Boolean getLogueado() {
		return logueado;
	}

	public void setLogueado(Boolean logueado) {
		this.logueado = logueado;
	}

	public static Sistema getInstance() {
        if (instance == null){
        	instance = new Sistema();
        	
        }

        return instance;
    }

    private Sistema() {
    	alarmListOld = new ArrayList<Date>();
    	alarmListNew = new ArrayList<Date>();
    	latitud = null;
    	longitud = null;
    	logueado = false;
    }
    
	public List<Date> getAlarmList() {
		List<Date> returnList = new ArrayList<Date>();
		returnList.addAll(alarmListOld);
		returnList.addAll(alarmListNew);
		return returnList;
	}

	public List<Date> getAlarmListOld() {
		return alarmListOld;
	}

	public void setAlarmList(List<Date> alarmList) {
		this.alarmListOld = alarmList;
	}
	
	public List<Date> getAlarmListNew() {
		return alarmListNew;
	}
	
	public void addAlarm(Date newAlarm) {
		newAlarm.setSeconds(0);
		this.alarmListNew.add(newAlarm);
	}
	
	public void setCoordenadas(Double latitud, Double longitud){
		this.latitud = latitud;
		this.longitud = longitud;
	}
	
	public Double getLongitud(){
		return longitud;
	}
	
	public Double getLatitud(){
		return latitud;
	}

	public void resetValues() {
		alarmListOld = new ArrayList<Date>();
		alarmListNew = new ArrayList<Date>();
		latitud = 0.0;
		longitud = 0.0;
	}
	
}
